package com.liu.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * Feign服务调用，fallbackFactory服务降级的处理类
 */
@FeignClient(value = "PROVIDER", fallbackFactory = UsersClientServiceFallbackFactory.class)
public interface UsersClientService {

    @RequestMapping(value = "/provider/users/addUsers", method = RequestMethod.POST)
    public void addUsers(@RequestBody JSONObject param);

    @RequestMapping(value = "/provider/users/delUsers", method = RequestMethod.DELETE)
    public void delUsers(@RequestParam(value = "userId") String userId);

    @RequestMapping(value = "/provider/users/modifyUsers", method = RequestMethod.PUT)
    public void modifyUsers(@RequestBody JSONObject param);

    @RequestMapping(value = "/provider/users/queryUsersCount", method = RequestMethod.GET)
    public JSONObject queryUsersCount(@RequestParam(value = "usersString") String usersString);

    @RequestMapping(value = "/provider/users/queryUsers", method = RequestMethod.GET)
    public JSONObject queryUsers(@RequestParam(value = "usersString") String usersString);
}
